/**
 * 字典路由文件
 */

const Router = require('koa-router');
const router = new Router();
const { getSubjectList, getPositionList, getLogsList, getList, getTypes, add, update, getGradeList, getStudentStatus, getStudentRecords, getStudentFee, getAttendanceList, getAuditStatus } = require('../services/dictionary');
const { validate } = require('../validators/common');
const { validType, validAdd, validUpdate } = require('../validators/dictionary');

router.prefix('/dictionary');

router.get('/getSubjects', getSubjectList);

router.get('/getPositions', getPositionList);

router.get('/getLogs', getLogsList);

router.get('/list/:type', validate(validType), getList);

router.get('/types', getTypes);

router.post('/add', validate(validAdd), add);

router.put('/update', validate(validUpdate), update);

router.get('/grades', getGradeList);

router.get('/status', getStudentStatus);

router.get('/records', getStudentRecords);

router.get('/fee', getStudentFee);

router.get('/attendance', getAttendanceList);

router.get('/auditStatus', getAuditStatus);

module.exports = router;